package com.axend.aerosense.common;

public class UrlApi {

//    private final static String BASE_URL = "https://aerosense.timevary.com:82/";  //国内正式服
//    private final static String BASE_URL = "https://aerosense.timevary.com:9443/";  //国内预生产环境

//    private static String BASE_URL = "http://10.8.4.131:8080/";  //测试服
//    private static String BASE_URL = "http://10.8.4.111:8882/";  //内网测试服
    private static String BASE_URL = "http://10.8.0.10:8080/";  //内网测试服


//    public static String radarTcpServerUrl = "10.8.4.131,8801";  //ASSURE雷达连接地址
    public static String radarTcpServerUrl = "10.8.0.10,8801";  //ASSURE雷达连接地址


//    ----------------------------------------------------------------------------------------------------------------------------

    // 安如氏海外版服务器
//    private static String BASE_URL = "https://aerosense.ax-end.com:8803/";
    // 用户协议：
    public final static String userProtocolUrl = "https://aerosense.ax-end.com:8082/html/EndUserAgreement.html";
    // 隐私政策：
    public final static String privacyProtocolUrl = "https://aerosense.ax-end.com:8082/html/PrivacyPolicy.html";
    // 帮助反馈地址
    public final static String helpUrl = "https://aerosense.ax-end.com:8082/html/Help.html";
    // 用户手册
    public final static String explainUrl = "https://aerosense.ax-end.com:8082/html/instruction.html";
    // Restful请求 获取雷达工作距离
    public final static String getWorkRangeUrl = BASE_URL+"radar/getWorkRange/";
    //获得呼吸雷达的参数数据
    public final static String getHeartDevArgsUrl = BASE_URL+"User/getRadarSetup/";

    /**
     * ASSURE、WAVVE
     * 安如氏防摔雷达、呼吸心率雷达连接服务器地址
     * 设置雷达需要连接服务器的ip和端口
     * 注意：此链接在连接防摔雷达的时已设置
     * IP与端口用英文的【,】分隔
     */
//    public static String radarTcpServerUrl = "aerosense.ax-end.com,8801";

    /**
     *         int av=1;//协议版本
     *         int rv=0;//地区 0:国内 1：国际
     */
    private final static String PARAMS = "?av=2&rv=1";

    public static String getPARAMS() {
        return PARAMS;
    }

    public static String getBaseUrl() {
        return BASE_URL;
    }

    public static String getRadarTcpServerUrl(){
        return radarTcpServerUrl;
    }

    public static void setRadarTcpServerUrl(String radarTcpServerUrl) {
        UrlApi.radarTcpServerUrl = radarTcpServerUrl;
    }

    public static void setBaseUrl(String url){
        UrlApi.BASE_URL = url;
    }

    public static enum URL{
        // 1. 注册地址
        Register("Register.do"),
        // 2. 验证码地址
        Verification("Verification.do"),
        // 3. 密码登录地址
        PwdLogin("Login.do"),
        // 4. 验证码登录地址
        VcodeLogin("VerifyCodeLogin.do"),
        // 6. 首页数据地址
        UserHome("User/UserHome.do"),
        // 8. 添加紧急联系人
        AddEmergencyContact ("User/setEmergencyContact.do"),
        // 9. 获取紧急联系人列表地址
        EmergencyContactList ("User/getEmergencyContact.do"),
        // 13. 设置收监护人地址
        AddWard ("User/setWard.do"),
        // 14. 获取监护人列表地址
        WardList ("User/getWard.do"),
        // 15. 获取指定受监护人信息
        GetWard("User/getWardByUUID.do"),
        // 17. 更新受监护人信息
        UpdateWard("User/upWard.do"),
        // 10. 获取紧急联系人信息
        GetPerson("User/getEmergencyContactByUUID.do"),
        // 12. 更新急联系人信息
        UpdatePerson("User/upEmergencyContact.do"),
        // 16. 删除受监护人地址
        DelWard("User/delWard.do"),
        // 11. 删除紧急联系人地址
        DelEmergencyContact("User/delEmergencyContact.do"),
        // 5. 登出
        Logout("User/LogOff.do"),
        // 18. 获取房间种类列表
        GetRoomType("User/getRoomType.do"),
        // 19. 创建房间
        CreateRoom("User/setRoom.do"),
        // 21. 获取房间列表
        GetRoomList("User/getAllRoom.do"),
        // 7. 获取雷达是否联网
        GetRadarNetworkStatus("User/getKeepAlive.do"),
        // 20. 获取指定房间的房间信息
        GetRoomInfo("User/getRoom.do"),
        // 22. 更新房间设置信息
        UpdataRoomSettingInfo("User/upRoom.do"),
        // 24. 获取房间设置信息
        GetRoomSettingInfo("User/getRoomSet.do"),
        // 25. 删除房间信息
        DelRoom("User/delRoom.do"),
        // 27. 获取房间所有日志信息
        GetRoomLog("User/getRoomLog.do"),
        // 28. 获取单条日志详情
        GetLogDetail("User/getLog.do"),
        // 30. 获取首页所有日志信息
        GetAllLog("User/getAllLog.do"),
        // 29. 删除指定日志
        DeleteLog("User/deLog.do"),
        // 31. 更新用户名称
        UpdataNick("User/upUserName.do"),
        // 32. 更新用户性别
        UpdataSex("User/upUserSex.do"),
        // 33. 设定邮箱
        SetEmail("User/upUserEmail.do"),
        // 34. 设置雷达属性
        SetRadarInfo("User/setRadar.do"),
        // 35. 获取绑定雷达房间页
        GetBindRadarRoom("User/selRoomMapRadar.do"),
        // 36. 雷达绑定房间
        SetRadarBindRoom("User/setRoomMapRadar.do"),
        // 37. 更新密码
        UpdataPassword("updatePass.do"),
        // 38. 绑定前验证手机号
        BindCheckPhone("User/VerificationUserPhone.do"),
        // 39. 更改绑定手机号
        ReBindingPhone("User/upUserPhone.do"),
        // 40. 获取全部的设备
        GetAllDev("User/getAllRadar.do"),
        // 41. 获取指定雷达的信息
        GetDevInfo("User/getRadar.do"),
        // 42. 更新指定雷达的名称
        UpdataDevName("User/upRadarName.do"),
        // 43. 获取登录设备列表
        GetLoginDevList("User/getUserDevice.do"),
        // 44. 删除指定登录设备信息
        DelLoginDevInfo("User/delUserDevice.do"),
        // 45. 删除雷达
        DelRadar("User/delRadar.do"),
        // 46. 批量移动雷达
        MoveRadars("User/upRadars.do"),
        // 47. 批量删除雷达
        DeleteRadars("User/delRadars.do"),
        // 48. 获取app版本信息（检查更新）
        GetAppVersion("updateVersion.do"),
        // 49. 发送PushToken到服务器
        SetPushToken("User/UserPushToken.do"),
        // 50. 检查雷达固件是否需要更新
        GetFirmwareVersion("User/getRadarFirmware.do"),
        //51.头像上传
        ImageIcon("User/upLoad.do"),
        //52.用户注销
        CancelUser("User/cancelUser.do"),
        // 53 获取所有预警信息
        GetAllEarlyWarningLog("User/getAllEarlyWarningLog.do"),
        // 54 获取单条预警信息详情
        GetEarlyWarningLog("User/getEarlyWarningLog.do"),
        // 54 删除单条预警信息
        DelEarlyWarningLog("User/delEarlyWarningLog.do"),
        // 55 离家模式开关接口
        UpdateLeaveHome("User/upLeaveHome.do"),

        // 56 外出未归设置
        SetEgressNoReturn("User/setEgressNoReturn.do"),
        // 57 睡眠超时
        SetSleepOvertime("User/setSleepOvertime.do"),
        // 58 连续久坐
        SetContinuitySit("User/setContinuitySit.do"),
        // 59 累积久坐
        SetAccumulateSit("User/setAccumulateSit.do"),
        // 60 卫生间滞留设置
        SetToiletStop("User/setToiletStop.do"),
        // 61 原地静止设置
        SetPositionStatic("User/setMotionlessAlert.do"),
        // 62 用餐分析
        SetHaveMeals("User/setHaveMeals.do"),
        // 63 起夜分析
        SetNightRise("User/setNightRise.do"),
        // 64 起夜未归设置
        SetNightRiseNoReturn("User/setNightRiseNoReturn.do"),
        // 65 作息规律设置
        SetWorkAndrest("User/setWorkAndrest.do"),
        // 66 睡眠质量设置
        SetSleepAnalysis("User/setSleepAnalysis.do"),
        // 67 卫浴使用分析设置
        SetToiletAnalysis("User/setToiletAnalysis.do"),
        // 68 趋势分析设置
        SetTrendAnalysis("User/setTrendAnalysis.do"),
        //69 支付请求发起
        VipPay("User/VipPay.do"),
        //70 支付订单结果通知查询
        PayResultCheck("User/UserGetPayInfo.do"),
        //71 获取手机地区号
        GetPhoneAreaCode("User/getPhoneAreaCode.do"),
        //72 查询所有订单记录
        GetHistoricalTransaction("User/getHistoricalTransaction"),
        //73 合并用户页面所有信息
        QueryAllUserInfoResult("goods/getUserVipInfoAndGoodsList"),
        //74 查询vip状态
        QueryUserVipStatus("User/QueryUserVipStatus.do"),
        // 75 查询健康报告记录
        getAllWard("User/getAllWard.do"),
        // 76 设定房间名称
        SetRoomName("User/upRoomName.do"),
        // 77 设定房间的种类
        SetRoomType("User/upRoomType.do"),
        // 78 设定房间城市位置
        SetRoomPosition("User/setRoomPosition.do"),
        // 79 设定房间紧急联系人
        SetRoomEmergency("User/upRoomEmergency.do"),
        // 80 设定房间受监护人
        SetRoomWard("User/upRoomWard.do"),
        // 81 获取通知
        GetNotice("getNotice.do"),
        // 82 vip过期天数检查
        GetVipRenewNotice("User/MemberReminder.do"),
        // 83 谷歌服务器验证订单
        GooglePayVerifyOrder("user/pay/google/verifyOrder"),


        // 85 获取可绑定设备类型列表
        GetRadarType("User/getRadarType.do"),
        // 86 获取编辑的房间
        GetEditRoom("User/getAllRoomSort.do"),
        // 87 设置已排序好的房间
        SetAllRoomSort("User/setAllRoomSort.do"),
        // 88 获取未分配设备
        GetUnassignedDevices("User/getUnassignedDevicesRadar.do"),
        // 89 房间门口位置保存
        SavePointResult("radar/position/study/saveResult"),
        // 90 获得雷达工作距离 Restful请求 position/study/getWorkRange/{radarUuid}
        GetWorkRange("position/study/getWorkRange"),
        // 91 设置心跳/呼吸骤停告警
        SetNoVitalSignals("User/setNoVitalSignals.do"),
        // 92 设置离床告警
        SetBedExitWarning("User/setBedExitWarning.do"),
        // 93 设置作息异常
        SetAbnormalSleep("User/setAbnormalSleep.do"),
        // 94 呼吸&心率雷达校准
        OpenDeviceCalibration("radar/openDeviceCalibration"),
        // 95 保存雷达参数设置
        SetRadarSettings("User/setRadarInfo.do"),
        // 96 获取雷达参数设置
        GetRadarSettings("User/getRadarInfo.do"),
        // 97 雷达固件开始升级
        UpRadarFirmware("User/upRadarFirmware.do"),
        // 98 获取第二种弹窗通知
        GetWindowNotice("getWindowNotice.do"),
        // 99 查询雷达固件升级状态
        GetUpgradeStatus("User/getUpgradeStatus"),
        // 100 获取设备连接的服务器IP和端口
        GetRadarTcpServer("/User/getRadarTcpServiceAddress"),

        // 101 摔倒报警开关
        FallAlertSwitch("User/setFallAlertSwitch.do"),
        SetInstallConfiguration("User/setInstallationConfiguration.do"),
        GetInstallConfiguration("User/getInstallationConfiguration.do"),
        GetRadarTipsState("User/getRadarTipsState.do")
        ;

        private String url;
        URL(String tmp){
            url = tmp;
        }

        public String getUrl(){
            return BASE_URL + url + PARAMS;
        }


    }

}
